1. Field of the Invention
The present invention relates to an image processing apparatus and an image processing method performing a predetermined image processing for image data and a storage medium storing a program readable by a computer and a program.
2. Related Background Art
Swallowed up by the waves of digitalization in the recent years, a typical digital camera instead of the conventional silver camera has rapidly dominated in the market. This is believed linked to easiness of handling of digitalized image data due to popularization of personal computers (hereinafter, referred to as PC) among many people.
In addition to the above, due to highly developed semiconductor manufacturing technologies, high-pixel and high-resolution images taken by the digital camera have given a boost to this phenomenon.
Moreover, accompanied with advanced and sophisticated features of mobile equipment such as cellular phones and PDA, the equipment mounted with the digital camera has come onto the market, and even those who do not have the PC have a myriad of opportunities to come in contact with digital photography.
For these users, a printer capable of printing without being connected to the PC has appeared on the scene so that the printing can be made without the intermediary of the PC. This has been realized by allowing a printer main body to have the image processing function performed by the host side PC.
FIG. 19 is a block diagram to explain a data processing state of the conventional image processing apparatus and, for example, shows one example of an image processing, which is performed by a printer as the image processing apparatus.
In FIG. 19, reference numeral 101 denotes a decoding processing portion, which decodes an image data encoded into a compressed format such as a JPEG (Joint Photographic coding Experts Group: ISO/IEC ITU-TT. 81 or ISO/IEC IS 10918-1). Here, for the image data encoded into the JPEG format, an entropy decryption, a reverse quantization, and a reverse DCT conversion are performed, thereby executing a decoding processing. The detailed description of each processing will be omitted since it has nothing to do with the substance of the present patent application. By this decoding processing, the image data of a luminance (Y) and a color difference (Cb and Cr) format is generated in a unit of 8×8 pixels.
Reference numeral 102 denotes a color processing portion, which subjects the image data decoded by a YCbCr format to an image correction and a color conversion processing, and converts it into ink colors of the printer.
Reference numeral 103 denotes an image correction processing portion, which is capable of executing various processings such as a correction of a white balance of the image, an exposure correction, a correction processing to a monochrome or a sepia, a removal of CCD noises contained in the image taken by the digital camera, a filtering processing of low pass/high pass and the like.
Subsequently, a color conversion processing portion 104 subjects the image data corrected by the YcbCr format to a conversion processing to the ink colors of the printer, for example, Cyan, Magenta, and Yellow.
The image data converted into the ink colors is transferred to a quantization processing portion 105 so as to be converted into tones printable by the printer.
As for the method of the quantization processing, an error diffusion method, a dither method using a matrix and the like can be cited. Through these processes, the data of the ink colors of the printer is transferred to a recording control portion (not shown) of the printer as printable tone data.
FIG. 20 is a block diagram to explain the detail of the data processing in the color processing portion 102 shown in FIG. 19, which explains a writing/reading state of the image data to a buffer in the color processing portion 102.
In FIG. 20, reference numeral 201 denotes a decoding processing, which prepares a decoding buffer 202 of the multiples of eight lines because the image comes to be decoded with a unit of 8×8. In this example, the data stored in the decoding buffer 202 is copied in an image correction buffer 204 for the image correction, in which a desired processing is executed. The number of lines of the image correction buffer 204 at this time is determined according to the content of the processing.
For example, if the processing is reduction processing of the CCD noises to be described later, the processing is of 17 lines, and if the processing is filter processing using a 3×3 matrix for the JPEG complex data disclosed in Japanese Patent Application Laid-Open No. H10-32709, the processing is of three lines. The data subjected to the correction processing is written to a color conversion buffer 206 for every one line, and color conversion processing is executed at the above-described color conversion processing portion 205.
In the color conversion processing portion 205, the converted data is overwritten on the same color conversion buffer 206, so that the storage capacity of a memory can be reduced. Further, the reason why a processing unit is one line each is because it is to reduce the storage capacity of the memory as small as possible.
After one raster data processing is performed in the image correction processing portion 203, when the next one line is required for the image correction buffer 204, a request for one line is submitted to the decoding processing portion 201. When one line exists in the decoding buffer 202, the raster data thereof is delivered to the image correction processing portion 203, and the image correction processing portion 203 performs the processing of writing it in the image correction buffer 204. When the raster data to be transmitted does not exist in the decoding buffer 202, the decoding processing portion 201 executes the decoding processing, and generates a raster data of the multiples of eight in the decoding buffer 202 and delivers a desired raster data to the decoding buffer 202.
In this manner, even when a data for eight lines is created by the decoding processing at one time as in the case of the JPEG image, it is possible for the image correction portion 203 to submit a request for one line unit by the decoding buffer 202 having a size of the multiples of eight lines. By repeating this processing, the color processing portion 208 delivers one line data, which has executed the image correction 203 and the color conversion processing 205, to a quantization processing portion 207.
The conventional image processing apparatus is configured as described above. In the case of the configuration (built-in system printer) where such a printer main body has an image processing function, it is difficult to have a high-capacity memory and a high-speed CPU if the cost of the printer main body is considered. Consequently, the built-in system printer is often by far inferior in its performance comparing to the host of the PC such as the storage capacity of a memory, CPU, the speed of an internal bus and the like.
A study is made of the case where a correction is performed on the image generated by multi-raster, which is represented by the JPEG. In the access to the buffer memory as described above in FIG. 20, when the writing processing is observed, there occur writing processes four times before reaching the quantization processing such as a writing in the decoding buffer, a writing in the image correction buffer, a writing in the color conversion buffer of the data subsequent to correction, and overwriting on the color conversion buffer of the data subsequent to the color conversion.
If a system is provided for a memory having high capacity and being accessible at a high speed as in the case of the PC, it does not cause a serious trouble as far as this point is concerned.
However, in the case where the memory capacity is strictly limited in the built-in system printer in which the printer main body has the image processing function, and in the case where the system is slow in the memory access, above all, in the writing processing, it becomes an important problem how to reduce the writing processing so as to reduce the memory capacity and speed up the memory access.
In Japanese Patent Application Laid-Open No. 2000-156830, an attempt is made such that the data decoded and subjected to a predetermined image processing is stored in a primary buffer, which temporarily stores the data, thereby speeding up the data processing. However, this causes an increase in the memory capacity, and a writing processing when the data is stored in the primary buffer.
Further, in Japanese Patent Application Laid-Open No. H06-217094, the speeding up of outputting the plural number of pages is realized while having a circular buffer (ring buffer) and maintaining the downsizing of the buffer and its efficiency. However, no consideration is given to an image correction generating the multi raster such as the conventional technology. Moreover, there has been a problem in that the reduction in the number of accesses is also left as a problem, for example.